package com.zhq.blog.core.domain.game.support;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.zhq.blog.core.domain.BaseRepository;

/**
 * @title:CathecticModelRepository.java
 * @package com.zhq.blog.core.domain.game.support
 * @author 张恒强
 * @date 2014年12月26日 下午2:32:30
 * @version V1.0
 */
public interface CathecticModelRepository extends JpaRepository<CathecticModel, Long>,
							BaseRepository<CathecticModel>,JpaSpecificationExecutor<CathecticModel>{

	@Query("select c from CathecticModel c where c.deleted = 0 and c.gameId = :gameId and c.userId = :userId")
	Page<CathecticModel> find_all_by_game_user(@Param("gameId") long gameId,@Param("userId")long userId,Pageable pageable);
	
	@Query("select c from CathecticModel c where c.deleted = 0 and c.gameId = :gameId and c.userId = :userId")
	List<CathecticModel> find_all_by_game_user(@Param("gameId") long gameId,@Param("userId")long userId);
}
